// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: stub.hpp 225 2008-09-12 17:43:02Z heavyzheng $
//

#ifndef ZZHENG_QUANT_DATES_STUB_HPP_20080709__
#define ZZHENG_QUANT_DATES_STUB_HPP_20080709__

#include <zzheng/quant/dates/config.hpp>


namespace zzheng {
namespace quant {
namespace dates {

    //! The stub enumeration defines how to generate irregular period in the schedule.
    enum stub_t {
        no_stub = 0,
        short_first,
        short_last,
        long_first,
        long_last,
    };

    inline
    bool is_long(stub_t stub) {
        return (stub == long_first || stub == long_last);
    }

    inline
    bool is_short(stub_t stub) {
        return (stub == short_first || stub == short_last);
    }

    inline
    bool is_first(stub_t stub) {
        return (stub == short_first || stub == long_first);
    }

    inline
    bool is_last(stub_t stub) {
        return (stub == short_last || stub == long_last);
    }

} // namespace zzheng::quant::dates
} // namespace zzheng::quant
} // namespace zzheng

#endif // ZZHENG_QUANT_DATES_STUB_HPP_20080709__


